Documentation for class number

Inherits from 	basic_object 

Properties declared in number 

Class Methods declared in number 

Methods declared in number 
	any 
		abs 
		acos 
		acosh 
		add(number) 
		asin 
		asinh 
		atan 
		atanh 
		cbrt 
		ceiling 
		cos 
		cosh 
		divide(number) 
		divide_and_truncate(number) 
		divide_with(number) 
		exp 
		exp1 
		floor 
		is_equal_to(object) 
		is_greater_than(number) 
		is_greater_than_or_equal(number) 
		is_less_than(number) 
		is_less_than_or_equal(number) 
		j0 
		j1 
		jn(n) 
		ln 
		ln1 
		ln10 
		negate 
		raised_to(number) 
		remainder(number) 
		round 
		sin 
		sinh 
		sqrt 
		subtract(number) 
		subtract_from(number) 
		tan 
		tanh 
		times(number) 
		y0 
		y1 
		yn(n) 
	bessel 
		j0 
		j1 
		jn(n) 
		y0 
		y1 
		yn(n) 
	hyperbolic 
		acosh 
		asinh 
		atanh 
		cosh 
		sinh 
		tanh 
	inv_hyperbolic 
		acosh 
		asinh 
		atanh 
	trig 
		acos 
		asin 
		atan 
		cos 
		sin 
		tan 

Class 
#begin_class
number 
The class number is a sub-class of the class basic_object. 
Examples of numbers are:
1
23.456
7654329187625312

The mathematical functions like sin(x) are implemented as methods in the number class. You can use the syntax you prefer.
45:sin
or
sin(45)
#end_class

Properties 

Methods 

#begin_method
abs 
Returns the absolute value of the number, i.e. without the minus sign.
Ex:
abs(23)
returns 23
abs(-23)
returns 23
#end_method

#begin_method
acos 
Returns the acos of a factor.
Ex:
acos(0.6)
returns 0.927295
#end_method

#begin_method
acosh 
Returns the acos hyperbolicus of a factor.
Ex:
acosh(1.1)
returns 0.443568
#end_method

#begin_method
add(number) 
Returns the sum of the receiving number and number.
Ex:
25:add(30)
returns 55
Note: This is equivalent to add(25, 30) and 25 + 30.
#end_method

#begin_method
asin 
Returns the asin of a factor.
Ex:
asin(0.6)
returns 0.643501
#end_method

#begin_method
asinh 
Returns the asin hyperbolicus of a factor.
Ex:
asinh(1.1)
returns 0.950347
#end_method

#begin_method
atan 
Returns the atan of a factor.
Ex:
atan(1.0)
returns 0.785398
#end_method

#begin_method
atanh 
Returns the atan hyperbolicus of a factor.
Ex:
atanh(0.5)
returns 0.549306
#end_method

#begin_method
cbrt 
Returns the cubic root of the number.
Ex:
cbrt(125)
returns 5
#end_method

#begin_method
ceiling 
Returns the smallest integer no less than the number.
Ex:
ceiling(2.5)
returns 3
ceiling(-2.5)
returns -2
#end_method

#begin_method
cos 
Returns the cosinus of an angle. The angle must be expressed in radians.
Ex:
cos(0.7)
returns 0.764842
#end_method

#begin_method
cosh 
Returns the cosinus hyperbolicus of an angle. The angle must be expressed in radians.
Ex:
cosh(0.7)
returns 1.255169
#end_method

#begin_method
divide(number) 
Returns number divided by the receiving number.
Ex:
2:divide(15)
returns 7.500000
Note: This is equivalent to divide(2, 15) and 15 / 2.
#end_method

#begin_method
divide_and_truncate(number) 
Returns the receiving number divided by number rounded down to the nearest lower integer.
Ex:
15:divide_and_truncate(2)
returns 7
Note: This is equivalent to divide_and_truncate(15, 2) and 15 // 2.
#end_method

#begin_method
divide_with(number) 
Returns the receiving number divided by number.
Ex:
15:divide_with(2)
returns 7.500000
Note: This is equivalent to divide_with(15, 2) and 15 / 2.
#end_method

#begin_method
exp 
Returns e raised to the number.
Ex:
exp(1)
returns 2.718282
#end_method

#begin_method
exp1 
Returns e raised to the number minus 1, (i.e. exp(x) - 1).
Ex:
exp1(1)
returns 1.718282
#end_method

#begin_method
floor
Returns the largest integer no greater than x.
Ex:
floor(2.5)
returns 2
floor(-2.5)
returns -3
#end_method

#begin_method
is_equal_to(object) 
Returns true if the number is equal to object.
Ex:
2:is_equal_to(2)
returns true
2:is_equal_to(2.0)
returns true
2:is_equal_to(3)
returns false
Note: These are equivalent to 2 = 2 and 2 = 3.
#end_method

#begin_method
is_greater_than(number) 
Returns true if the number is greater than number. Otherwise the method returns false.
Ex:
1:is_greater_than(2)
returns false
2:is_greater_than(2)
returns false
3:is_greater_than(2)
returns true
Note: These are equivalent to 1 > 2, 2 > 2 and 3 > 2.
#end_method

#begin_method
is_greater_than_or_equal(number) 
Returns true if the number is greater than or equal to number. Otherwise the method returns false.
Ex:
1:is_greater_than_or_equal(2)
returns false
2:is_greater_than_or_equal(2)
returns true
3:is_greater_than_or_equal(2)
returns true
Note: These are equivalent to 1 >= 2, 2 >= 2 and 3 >= 2.
#end_method

#begin_method
is_less_than(number) 
Returns true if the number is less than number. Otherwise the method returns false.
Ex:
1:is_less_than(2)
returns true
2:is_less_than(2)
returns false
3:is_less_than(2)
returns false
Note: These are equivalent to 1 < 2, 2 < 2 and 3 < 2.
#end_method

#begin_method
is_less_than_or_equal(number) 
Returns true if the number is less than or equal to number. Otherwise the method returns false.
Ex:
1:is_less_than_or_equal(2)
returns true
2:is_less_than_or_equal(2)
returns true
3:is_less_than_or_equal(2)
returns false
Note: These are equivalent to 1 <= 2, 2 <= 2 and 3 <= 2.
#end_method

#begin_method
j0 
Bessel function.
#end_method

#begin_method
j1 
Bessel function.
#end_method

#begin_method
jn(n) 
Bessel function.
#end_method

#begin_method
ln 
Returns the base-e (natural) logarithm of the number.
Ex:
ln(10)
returns 2.302585
#end_method

#begin_method
ln1 
Returns the base-e (natural) logarithm of the number plus 1, (i.e ln(x + 1)).
If the number is small, this method is more accurate than using standard arithmetic operations.
Ex:
ln1(10)
returns 2.397895
#end_method

#begin_method
ln10 
Returns the base-10 logarithm of the number.
Ex:
ln10(10)
returns 1.0
#end_method

#begin_method
negate 
Returns the number with the sign changed.
Ex:
negate(-2)
returns 2
negate(2)
returns -2
#end_method

#begin_method
raised_to(number) 
Returns the number raised to number.
Ex:
2:raised_to(5)
returns 32
Note: This is equivalent to raised_to(2, 5) and 2 ^ 5.
#end_method

#begin_method
remainder(number) 
Returns the reminder when the number is divide_and_truncated with number.
Ex:
25:remainder(3)
returns 1
Note: This is equivalent to reminder(25, 3) and 25 % 3.
#end_method

#begin_method
round 
Returns the nearest integer to the number.
Ex:
round(2.3)
returns 2
round(2.7)
returns 3
#end_method

#begin_method
sin 
Returns the sinus of an angle. The angle must be expressed in radians.
Ex:
sin(0.7)
returns 0.644218
#end_method

#begin_method
sinh 
Returns the sinus hyperbolicus of an angle. The angle must be expressed in radians.
Ex:
sinh(0.7)
returns 0.758584
#end_method

#begin_method
sqrt 
Returns the square root of the number.
Ex:
sqrt(25)
returns 5
#end_method

#begin_method
subtract(number) 
Returns number subtracted from the receiving number.
Ex:
30:subtract(5)
returns 25
Note: This is equivalent to subtract(30, 5) and 30 - 5.
#end_method

#begin_method
subtract_from(number) 
Returns the receiving number subtracted from number.
Ex:
5:subtract_from(30)
returns 25
Note: This is equivalent to subtract_from(5, 30) and 30 - 5.
#end_method

#begin_method
tan 
Returns the tangent of an angle. The angle must be expressed in radians.
Ex:
tan(2)
returns -2.185040
#end_method

#begin_method
tanh 
Returns the tangent hyperbolicus of an angle. The angle must be expressed in radians.
Ex:
tanh(0.7)
returns 0.604368
#end_method

#begin_method
times(number) 
Returns the product of the receiving number multiplied by number.
Ex:
3:times(4)
returns 12
Note: This is equivalent to times(3, 4) and 3 * 4.
#end_method

#begin_method
y0 
Bessel function.
#end_method

#begin_method
y1 
Bessel function.
#end_method

#begin_method
yn(n) 
Bessel function.
#end_method

Class Methods